/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import javax.swing.JTextArea;

import Interfaces.*;
import Controller.ChatController;

/**
 *
 * @author JC
 */
public class ChatGUI implements FromUser, ToUser{
    private ChatController chatController;
    private JTextArea jTextLogin;
    
    public ChatGUI()
    {
        chatController = new ChatController(this);
    }

    @Override
    public void connect() 
    {
        chatController.performConnect(displayLogin());
    }

    @Override
    public void disconnect() {
       chatController.performDisConnect(displayLogin());
    }

    @Override
    public String displayLogin() {
        return getjTextLogin().getText();
    }

    /**
     * @return the jTextLogin
     */
    public JTextArea getjTextLogin() {
        return jTextLogin;
    }
    
}
